package com.itljm.cxrMarket.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itljm.cxrMarket.common.Result;
import com.itljm.cxrMarket.entity.Articles;
import com.itljm.cxrMarket.service.ArticlesService;
import com.itljm.cxrMarket.mapper.ArticlesMapper;
import com.itljm.cxrMarket.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ArticlesServiceImpl extends ServiceImpl<ArticlesMapper, Articles> implements ArticlesService{
    @Autowired
    private ArticlesMapper articlesMapper;

    @Override
    public List<Articles> selectArticlesByPage(Page<Articles> page, QueryWrapper<Articles> wrapper) {
        return articlesMapper.selectArticlesByPage(page, wrapper);
    }

    @Override
    public Articles selectArticleById(Integer id) {
        return articlesMapper.selectById(id);
    }

    @Override
    public boolean saveOrUpdateArticle(Articles article) {
        return articlesMapper.insertOrUpdate(article);
    }

    @Override
    public boolean removeArticleById(Integer id) {
        return articlesMapper.deleteById(id)>0;
    }
}




